package com.nets.handler;

import com.nets.packet.PacketI;
import com.nets.pool.PacketThreadPool;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.ChannelInboundHandlerAdapter;

/**
 * @author sig
 * @since 2016/9/17
 */
public class PacketHandler extends ChannelInboundHandlerAdapter {

    @Override
    public void channelRead(ChannelHandlerContext ctx,
                            Object obj) throws Exception {
        if (obj instanceof PacketI) PacketThreadPool.execute((PacketI) obj);
    }
}
